<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>过渡效果3</title>
    <style>
        .sample {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 300px;
            height: 400px;
            background-color: chartreuse;
            transition: all 1s;   /* transition过渡效果是一个复合属性，其中all表示所有修改的属性生效，1s表示过渡时间 */
        }

        .pic2 {
            width: 216px;
            height: 290px;
            border-radius: 10px;
            cursor: pointer;
        }

        .sample:hover {
            width: 400px;
            height: 500px;
            background-color: crimson;
        }
        .sample:hover img {
            transform: scale(1.2);
        }
    </style>
</head>
<body>
    <div class="sample">
        <img src="./images/扫黑.webp" alt="" class="pic2">
    </div>
</body>
</html>